import { request } from "../Request";

//材料库管理
export function getMaterialRepositoryListApi(formData) {
  return request({
    url: `/materialLibrary/parseExcel`,
    method: 'post',
    data: formData
  });
}
export function getMaterialLibraryDataApi() {
  return request({
    url: `/materialLibrary/getMaterialLibraryData`,
    method: 'get',
  });
}
export function addMaterialLibraryItemApi(formData) {
  return request({
    url: `/materialLibrary/addMaterialLibraryItem`,
    method: 'post',
    data: formData
  });
}
export function deleteMaterialLibraryItemApi(formData) {
  return request({
    url: `/materialLibrary/deleteMaterialLibraryItem`,
    method: 'post',
    data: formData
  });
}
export function updateMaterialLibraryItemApi(formData) {
  return request({
    url: `/materialLibrary/updateMaterialLibraryItem`,
    method: 'post',
    data: formData
  });
}
export function queryMaterialLibraryListApi(keyWords) {
  return request({
    url: `/materialLibrary/queryMaterialLibraryList`,
    method: 'get',
    params:{
      keyWords:keyWords,
    }
  });
}
//零部件材料设置
export function getCurrentPartMaterialInfoApi(formData) {
  return request({
    url: `/materialSetting/getCurrentPartMaterialInfo`,
    method: 'post',
    data: formData
  });
}
export function addMaterialInfoToCurrentPartApi(formData) {
  return request({
    url: `/materialSetting/addMaterialItemToCurrentPart`,
    method: 'post',
    data: formData
  });
}
export function deleteMaterialInfoToCurrentPartApi(formData) {
  return request({
    url: `/materialSetting/deleteMaterialItemToCurrentPart`,
    method: 'post',
    data: formData
  });
}
export function getInsMaterialInfoByDocInfosApi(docInfoList) {
  return request({
    url: `/materialSetting/getInsMaterialInfoByDocInfos`,
    method: 'post',
    data: docInfoList
  });
}
